#!/usr/bin/env perl

use strict;
use warnings;

print "html_entities = {\n";
while (<>)
{
    s/[\012\015]*$//;
    my @bits = split(/\s+/);
    my $hex = $bits[2];
    my $html = $bits[0];
    $hex =~ tr/A-F/a-f/;
    $hex =~ s/^&#x([0-9a-f]+);$/$1/;
    $hex = ('0' x (4 - length($hex))).$hex;
    print "    u'\\u${hex}' : '$html',\n";
}
print "    }\n"
